Skip to content

Taxonomy table QA fixes#3000

Merged
brian-smith-tcril merged 12 commits intoopenedx:masterfrom
jesperhodge:taxonomy-qa-fixes-3
Apr 17, 2026
Merged

Taxonomy table QA fixes#3000
brian-smith-tcril merged 12 commits intoopenedx:masterfrom
jesperhodge:taxonomy-qa-fixes-3

Conversation

@jesperhodge
Copy link
Copy Markdown
Contributor

Description

This fixes some issues discovered in openedx/modular-learning#272 .

Testing instructions

See linked issue for what to test

Best Practices Checklist

We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:

  • Any new files are using TypeScript (.ts, .tsx).
  • Avoid propTypes and defaultProps in any new or modified code.
  • Tests should use the helpers in src/testUtils.tsx (specifically initializeMocks)
  • Do not add new fields to the Redux state/store. Use React Context to share state among multiple components.
  • Use React Query to load data from REST APIs. See any apiHooks.ts in this repo for examples.
  • All new i18n messages in messages.ts files have a description for translators to use.
  • Avoid using ../ in import paths. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 14, 2026
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @jesperhodge!

This repository is currently maintained by @bradenmacdonald.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

Copy link
Copy Markdown
Contributor

@tbain tbain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate modularizing some of this logic :) Approved

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 97.52066% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.47%. Comparing base (a0d5290) to head (6803971).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/taxonomy/tag-list/hooks.ts 92.30% 2 Missing ⚠️
src/taxonomy/tree-table/DraftRow.tsx 97.36% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3000      +/-   ##
==========================================
+ Coverage   95.46%   95.47%   +0.01%     
==========================================
  Files        1378     1383       +5     
  Lines       32596    32642      +46     
  Branches     7495     7498       +3     
==========================================
+ Hits        31117    31165      +48     
+ Misses       1410     1408       -2     
  Partials       69       69              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jesperhodge jesperhodge force-pushed the taxonomy-qa-fixes-3 branch from 5b23b51 to a44a221 Compare April 14, 2026 21:13
Copy link
Copy Markdown
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks great!

I left a few comments in there, mostly just general cleanup suggestions.

I also asked claude to take a look and it called out something I hadn't thought about. I don't think it's something I'm concerned about but I figured I'd share:

DraftRow (in tree-table/) imports UsageCountDisplay from tag-list/, while tag-list/ already imports from tree-table/. This creates a bidirectional dependency between the two directories — tree-table is meant to be the generic table layer but now has a direct dependency on a tag-list-specific component. Could UsageCountDisplay move into tree-table/, or could DraftRow accept it as a render prop instead?

Comment thread src/taxonomy/data/apiHooks.test.jsx Outdated
Comment on lines -241 to -243
} catch (err) {
throw new Error(getApiErrorMessage(err, intl));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is moving away from the catch/rethrow pattern desired for more than just these functions? Not something I would want to block this PR on, but if we're moving away from that it'd be good to make a follow-up issue to rework the rest of the places the catch/rethrow pattern is used in this file and no longer need to import getApiErrorMessage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern may be fine in other places where we don't want to display a part of a backend response body to the user. Also backend responses are inconsistent right now (there's a backend ADR working on that), so they may be handled differently in different places.

In this case the display string we want to show is in an array in err.response.data[field_key]. We have to extract this in our try catch block higher up anyway, depending on whether this is an AxiosError.
Throwing an Error is firstly not great (it should be specific) and secondly it does not have the fields with the information, so this is removing necessary information.

Rethrowing the AxiosError as a generic error here creates a loss of information, where just surfacing the AxiosError is completely fine. And a line like catch (err) { throw err } serves no purpose.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern may be fine in other places where we don't want to display a part of a backend response body to the user.

I understand the use case for it, it's more of a question of where the error message formatting should live. This PR is moving the formatting for the errors from happening inside this data/apiHooks.ts file into tag-list/hooks.ts. I like that change, and think it likely makes sense to do something similar for some of the other hooks in this file like useImportPlan.

As I mentioned before, this isn't a blocking thing, just something that seems like it'd be worth looking into as a follow-up issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I think so too.

If the error responses are becoming standardized on the backend, do you think it makes sense to wait for that so that we can handle them in the same way throughout the authoring frontend? Or do you think it's a smaller issue that should be done before then?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion on the timing. If it'll be easier to move away from the catch/rethrow pattern after the backend errors are standardized then waiting likely makes sense. I just want to make sure moving away from the pattern is tracked somewhere if it's something we plan on doing.

Comment thread src/taxonomy/tag-list/hooks.ts Outdated
Comment thread src/taxonomy/tag-list/tagColumns.tsx Outdated
Comment thread src/taxonomy/tag-list/TagListTable.test.jsx Outdated
Comment thread src/taxonomy/tree-table/DraftRow.tsx Outdated
Comment thread src/taxonomy/tree-table/DraftRow.tsx
Comment thread src/taxonomy/tag-list/UsageCountDisplay.tsx
Comment thread src/taxonomy/tree-table/NestedRows.tsx
Comment thread src/taxonomy/tree-table/SaveErrorAlert.tsx Outdated
Copy link
Copy Markdown
Contributor

@mgwozdz-unicon mgwozdz-unicon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks great to me. I appreciate the small refactor to clean up the code. I tested it locally as well and appears to solve the issues. Once Brian's comments are addressed, I think it will be good to merge.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Apr 16, 2026
@jesperhodge jesperhodge force-pushed the taxonomy-qa-fixes-3 branch from a952877 to 58ba86f Compare April 17, 2026 16:21
Comment thread src/taxonomy/tree-table/SaveErrorAlert.tsx Outdated
Copy link
Copy Markdown
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for working through this review with me!

I'm super happy with how this all came together!

@brian-smith-tcril brian-smith-tcril merged commit 9a416a2 into openedx:master Apr 17, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants